/* AI助手聊天页面样式 */
.ant-pro-layout .ant-pro-layout-content {
  padding: 12px !important;
  padding-block:12px !important; 
  padding-inline: 12px !important;
}

/* 聊天容器主布局 */
.chat-container {
  display: flex;
  height: 100%;
  position: relative;
  background-color: #fff;
  overflow: hidden;
}

/* 确保PageContainer样式正确应用 */
.ant-pro-page-container {
  height: 100vh !important;
  min-height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 移动端菜单切换按钮 */
.mobile-menu-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  background-color: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: none;
  /* 默认隐藏，在移动端显示 */
}

/* 侧边栏会话列表 */
.chat-sidebar {
  width: 300px;
  background-color: #fff;
  border-right: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 100;
}

/* 侧边栏头部 */
.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #333;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
}

.new-chat-btn {
  width: 32px;
  height: 32px;
  border: none;
  background-color: #1890ff;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.new-chat-btn:hover {
  background-color: #40a9ff;
  transform: scale(1.05);
}

/* 侧边栏搜索 */
.sidebar-search {
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.search-input {
  width: 100%;
}

/* 会话列表 */
.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.conversation-item {
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 12px 20px !important;
  margin: 0 !important;
  border-bottom: 1px solid #f0f0f0;
}

.conversation-item:hover {
  background-color: #f5f5f5;
}

.conversation-item.active {
  background-color: #e6f7ff;
  border-right: 3px solid #1890ff;
}

.conversation-title {
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
  font-size: 14px;
}

.conversation-description {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.last-message {
  flex: 1;
  color: #8c8c8c;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-time {
  color: #8c8c8c;
  font-size: 12px;
  min-width: 50px;
  text-align: right;
}

/* 聊天主区域 */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
  position: relative;
  height: 100%;
  overflow: hidden;
}

/* 聊天头部 */
.chat-header {
  background-color: #fff;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar {
  width: 40px;
  height: 40px;
}

.header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.header-status {
  margin: 0;
  font-size: 12px;
  color: #8c8c8c;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

.header-action-btn {
  width: 36px;
  height: 36px;
  border: none;
  background-color: transparent;
  color: #8c8c8c;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.header-action-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

/* 聊天内容区 */
.chat-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
}

/* 消息样式 */
.msg-item {
  display: flex;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease;
}

/* 消息操作按钮区域 */
.msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.msg-item:hover .msg-actions {
  opacity: 1;
}

/* 单个操作按钮 */
.msg-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background-color: transparent;
  color: #8c8c8c;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
}

.msg-action-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

/* 收藏列表样式 */
.starred-list .ant-list-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.starred-list .ant-list-item:last-child {
  border-bottom: none;
}

/* 确保页面根元素和父容器也有全屏高度 */
html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

/* 全局重置可能干扰高度的样式 */
* {
  box-sizing: border-box;
}

/* 确保所有父容器都能正确传递高度 */
#root {
  height: 100vh;
  overflow: hidden;
}

.ant-layout {
  height: 100vh !important;
  min-height: 100vh !important;
}

.ant-pro-basicLayout {
  height: 100vh !important;
  min-height: 100vh !important;
}

.msg-ai {
  justify-content: flex-start;
}

.msg-user {
  justify-content: flex-end;
}

.msg-item>div:last-child {
  max-width: 70%;
}

.msg-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-content {
  padding: 12px;
  border-radius: 8px;
  word-wrap: break-word;
  word-break: break-word;
}

.msg-ai .msg-content {
  background-color: #fff;
  border: 1px solid #f0f0f0;
  border-top-left-radius: 4px;
}

.msg-user .msg-content {
  background-color: #F3F3F3;
  color: #000;
  border-top-right-radius: 4px;
}

/* 头像动画 */
.avatar-animation {
  transition: all 0.3s ease;
}

.avatar-animation:hover {
  transform: scale(1.1);
}

/* 输入区域 - 固定在底部 */
.chat-input-area {
  background-color: #fff;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-textarea {
  resize: none !important;
  min-height: 80px !important;
  border-radius: 8px !important;
}

.input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.send-btn {
  padding: 8px 24px;
  background-color: #d9d9d9;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: not-allowed;
  font-size: 14px;
  transition: all 0.3s ease;
}

.send-btn.active {
  background-color: #1890ff;
  cursor: pointer;
}

.send-btn.active:hover {
  background-color: #40a9ff;
  transform: scale(1.05);
}

.input-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: #8c8c8c;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .chat-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  .chat-sidebar.open {
    transform: translateX(0);
  }

  .chat-main {
    margin-left: 0;
  }

  .chat-content {
    padding: 12px;
  }

  .chat-input-area {
    padding: 12px;
  }

  .msg-item>div:last-child {
    max-width: 85%;
  }
}

.more-icon-container {
  position: absolute !important;
  right: 16px !important;
}

@media (max-width: 480px) {
  .chat-sidebar {
    width: 280px;
  }

  .conversation-item {
    padding: 10px 16px !important;

  }

  .chat-header {
    padding: 12px 16px;
  }

  .header-avatar {
    width: 32px;
    height: 32px;
  }

  .header-title {
    font-size: 14px;
  }

  .header-status {
    font-size: 11px;
  }
}

/* 滚动条样式 */
.conversation-list::-webkit-scrollbar,
.chat-content::-webkit-scrollbar {
  width: 6px;
}

.conversation-list::-webkit-scrollbar-track,
.chat-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.conversation-list::-webkit-scrollbar-thumb,
.chat-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.conversation-list::-webkit-scrollbar-thumb:hover,
.chat-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 加载状态 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #8c8c8c;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #8c8c8c;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
}